package com.Mt.Controller;


import com.Mt.Dto.Dto;
import com.Mt.Service.MtBagService;
import com.Mt.Utils.DtoUtil;
import com.Mt.pojo.MtBag;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * (MtBag)表控制层
 *
 * @author makejava
 * @since 2020-12-07 17:49:52
 */
@RestController
@RequestMapping("/mtBag")
public class MtBagController {
    /**
     * 服务对象
     */
    @Reference
    private MtBagService mtBagService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
   /* @GetMapping("selfectOne")
    public MtBag selectOne(Integer id) {
        return this.mtBagService.queryById(id);
    }*/
   //@GetMapping("seloi/{id}")
   @GetMapping("seloi/{id}")
   public Dto seloneid(@PathVariable("id") int id){
       //MtBag s = mtBagService.seloneid(id);
       return DtoUtil.returnSuccessData(mtBagService.seloneid(id));
   }

    /**
     * 查询全部
     *
     * @return
     * 测试访问地址 : http://localhost:8085/mtBag/sel
     */
    @GetMapping("sel")
    public Dto sell(){
        return DtoUtil.returnSuccessData(mtBagService.sell());
    }

}